package com.zy.algorithm.v2;

import android.content.Intent;

import com.zy.activity.BaseMenuActivity;
import com.zy.activity.bean.BaseBean;
import com.zy.algorithm.v2.sort.BubbleSortFragment;
import com.zy.algorithm.v2.sort.BucketSortFragment;
import com.zy.algorithm.v2.sort.CountSortFragment;
import com.zy.algorithm.v2.sort.HeapSortFragment;
import com.zy.algorithm.v2.sort.HeapSortV2Fragment;
import com.zy.algorithm.v2.sort.InsertionSortFragment;
import com.zy.algorithm.v2.sort.MergeSortFragment;
import com.zy.algorithm.v2.sort.QuickSortFragment;
import com.zy.algorithm.v2.sort.RadixSortFragment;
import com.zy.algorithm.v2.sort.SelectSortFragment;
import com.zy.algorithm.v2.sort.ShellSortFragment;

import java.util.List;

public class AlgorithmV2MenuActivity extends BaseMenuActivity {


    @Override
    protected void init(List<BaseBean> list) {
        list.add(new BaseBean("排序算法"));

        list.add(new BaseBean("10.堆排序(V2)", HeapSortV2Fragment.class));
        list.add(new BaseBean("10.堆排序(V1)", HeapSortFragment.class));
        list.add(new BaseBean("9.桶排序", BucketSortFragment.class));
        list.add(new BaseBean("8.基数排序", RadixSortFragment.class));
        list.add(new BaseBean("7.计数排序", CountSortFragment.class));
        list.add(new BaseBean("6.归并", MergeSortFragment.class));
        list.add(new BaseBean("5.快速", QuickSortFragment.class));
        list.add(new BaseBean("4.希尔", ShellSortFragment.class));
        list.add(new BaseBean("3.插入", InsertionSortFragment.class));
        list.add(new BaseBean("2.选择", SelectSortFragment.class));
        list.add(new BaseBean("1.冒泡", BubbleSortFragment.class));
    }

    @Override
    protected void clickItem(BaseBean bean) {
        if (bean == null) {
            return;
        }
        Intent intent = new Intent(this, AlgorithmV2MainActivity.class);
        intent.putExtra("code", bean.getCode());
        intent.putExtra("targetClass", bean.getTargetClass());
        startActivity(intent);
    }
}